package routers

import (
	"software/api"
	"software/middleware"

	"github.com/gin-gonic/gin"
)

func (RouterGroup) PhotosRouter(router *gin.Engine) {
	photosApi := api.ApiGroupApp.PhotosApi
	// 图片相关路由
	api := router.Group("/photo")
	{
		api.Use(middleware.JWTMiddleware())
		api.GET("/:id", photosApi.QueryPhotoById)
		api.GET("/new", photosApi.QueryPhotoByNew)
		api.GET("/user/:id", photosApi.QueryPhotoByUserId)
		api.POST("/status", photosApi.UpdatePhotoStatus)
		api.GET("/all", photosApi.QueryTotalPhotos)
		api.GET("/list", photosApi.QueryPhotoList)
		api.DELETE("/delete/:id", photosApi.DeletePhotoById)
		api.GET("/category/stats", photosApi.QueryCategoryStats)
		api.GET("/status/total", photosApi.QueryTotalByStatus)

		// 图片审核相关路由
		api.POST("/audit/:id", photosApi.AuditImage)
		api.POST("/audit/sync", photosApi.AsyncAuditImage)

	}
}
